<div id="sidebar">
<?php if (url_contains("frontend") OR $_SERVER['REQUEST_URI'] == "/" OR $_SERVER['REQUEST_URI'] == "/index.php"):?>
	<?php if ($_SERVER['REQUEST_URI'] == "/" OR $_SERVER['REQUEST_URI'] == "/index.php"): ?>
	<ul>
		<li id="hot_society">
			<h2>热门社团</h2>
			<ul>
			<?php foreach ($hot_society as $k => $v):?>
			   <li><?php echo ($k + 1) . '.'?> <a href="<?php echo SOCIETY_HOME_PATH . $v['society_id']?>" ><?php echo $v['s_name']?></a> <spans>(<?php echo $v['view_count']?>)</spans></li>
			<?php endforeach;?>
			</ul>
		</li>
	</ul>
	<div id="announcement">
	<ul>
		<?php if (!empty($association_announcement)):?>
		<li>
			<h2>社联公告</h2>
			<ul>
			<?php foreach ($association_announcement as $v):?>
				<li><span><?php echo date("y.m.d", $v['create_time'])?></span><a class='association' title='<?php echo $v['title']?>' id='<?php echo $v['id']?>' style='cursor: pointer;'><?php echo ellipsize($v['title'], 12, .5)?></a></li>
			<?php endforeach;?>
			</ul>
		</li>
		<?php endif;?>
		
		<?php if (!empty($society_announcement)):?>
		<li>
			<h2>社团公告</h2>
			<ul>
			<?php foreach ($society_announcement as $v):?>
				<li><span><?php echo date("y.m.d", $v['create_time'])?></span><a class='society' title='<?php echo $v['title']?>' id='<?php echo $v['id']?>' style='cursor: pointer;'><?php echo ellipsize($v['title'], 12, .5)?></a></li>
			<?php endforeach;?>
			</ul>
		</li>
		<?php endif;?>
	</ul>
	</div>
	<?php endif;?>
	
	<?php if (url_contains(array("news", "login"))):?>
	<ul>
		<li id="recommend_news">
			<h2>新闻推荐</h2>
			<ul>
			<?php if (!empty($recommend_news)):?>
			<?php foreach ($recommend_news as $v):?>
				<li>
					<span><?php echo date("y.m.d", $v['create_time'])?></span>
					<a title='<?php echo $v['title']?>' href="<?php echo (($v['category_id'] == SOCIETY_UCID) ? SOCIETY_NEWS_DETAIL_PATH : ASSOCIATION_NEWS_DETAIL_PATH) . $v['id']?>">
					<?php echo ellipsize($v['title'], 12, .5)?>
					</a>
				</li>
			<?php endforeach;?>
			<?php endif;?>
			</ul>
		</li>
	</ul>
	<?php endif;?>
	
	<?php if (url_contains("society/home")):?>
	<ul>
		<li>
			<h2><?php echo $society['s_name']?> </h2>
			<ul id="user_info">
			<li>
			<div class="society_logo_thumb">
				<img id='society_logo_thumb' src='<?php echo (isset($logo_thumb_path)) ? '/' . $logo_thumb_path : '/images/no_pic.png'?>' alt='无法加载该图片' />
			</div>
			</li>
			<li>创建年份 <spans><?php echo $society['since']?></spans></li>
			<li>社团状态 <spans><?php echo $this->common_data->_get_society_status_by_confirm_flag_public($society['confirm_FLAG'])?></spans></li>
			<li>浏览次数 <spans><?php echo $society['view_count']?>次</spans></li>
			</ul>
		</li>
		
		<?php if (!empty($announcement)):?>
		<script>
		$("#announcment a").live("click", function() {
			var id = $(this).attr('id');
			var category = $(this).attr('class');
			ajax_get_announcement(id, category);
		});
		</script>
		<li id='announcment'>
			<h2>社团公告</h2>
			<ul>
			<?php foreach ($announcement as $v):?>
				<li><span><?php echo date("y.m.d", $v['create_time'])?></span><a class='society' title='<?php echo $v['title']?>' id='<?php echo $v['id']?>' style='cursor: pointer;'><?php echo ellipsize($v['title'], 12, .5)?></a></li>
			<?php endforeach;?>
			</ul>
		</li>
		<?php endif;?>
	</ul>
	<?php endif;?>
	
	<?php if (url_contains("society/society_list")):?>
	<ul>
		<li id="society_category_intro">
			<h2>社团分类简介</h2>
			<ul>
			<?php $temp = $this->common_data->_get_society_category_name_by_cid();?>
			<?php for ($i = 1; $i < count($temp); $i++):?>
				<li>
					<span><?php echo $i . '.'?></span>
					<a style='cursor: pointer;'><?php echo $temp[$i]?></a>
				</li>
			<?php endfor;?>
			<?php //endif;?>
			</ul>
		</li>
	</ul>
	<?php endif;?>
<?php elseif (url_contains("backend")):?>
<?php if (url_contains("society")):?>
	<ul>
		<li>
		<h2><?php echo $sidebar_info['re_society_name']?></h2>
		   <div class='accordion'>
				<h3><a href="#">基本信息</a></h3>
				<div>
				<ul id="user_info">
					<?php if (!empty($sidebar_info['logo_thumb'])):?>
					<li><div class='society_logo_thumb'><?php echo "<img id='society_logo_thumb' src='" . BASE_URL . $sidebar_info['logo_thumb'] . "' alt='无法加载该图片' />"?></div></li>
					<?php else:?>
					<li><div class='society_logo_thumb'><?php echo "<img id='society_logo_thumb' src='" . BASE_URL . "images/no_pic.png' alt='无法加载该图片' />"?></div><br />您的社团还没有<a href='<?php echo base_url()?>index.php/backend/society_upload/upload_init/1'>上传Logo</a>哦!</li>
					<?php endif;?>
					<li>注册人 &nbsp;&nbsp;&nbsp;<spans><?php echo $sidebar_info['re_person']?></spans></li>
					<li>社团状态 <spans><?php echo $sidebar_info['status']?></spans></li>
				</ul>
				</div>
			</div>
		</li>
	</ul>
	<?php elseif (url_contains("association")):?>
	<?php if ($_SESSION['function_FLAG'] == NOT_FUNCTION):?>
	<ul>
		<li>
		<h2>个人信息</h2>
		<ul id="user_info">
		   <li>姓名 <spans><?php echo $sidebar_info['re_name'];?></spans></li>
		   <li>所属部门 <spans><?php echo $sidebar_info['department_name']?></spans></li>
		   <li>状态 <spans><?php echo $sidebar_info['status']?></spans></li>
		</ul>
		</li>
	</ul>
	<?php else:?>
	<ul>
		<li>
		<h2>帐号信息</h2>
		<ul id="user_info">
		   <li>账户别名 <spans><?php echo $sidebar_info['re_name'];?></spans></li>
		   <li>所属部门 <spans><?php echo $sidebar_info['department_name']?></spans></li>
		</ul>
		</li>
	</ul>
	<?php endif;?>
	<?php elseif (url_contains("teacher")):?>
	<ul>
		<li>
		<h2>个人信息</h2>
		<ul id="user_info">
		   <li>姓名 <spans><?php echo $sidebar_info['re_name']?></spans></li>
		   <li>指导社团 <spans><?php echo $sidebar_info['direct_society']?></spans></li>
		</ul>
		</li>
	</ul>
	<?php endif;?>
<?php endif;?>
</div>
<!-- end #sidebar -->